<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWeekCheckoutsTable extends Migration
{
    /**
     * Run the migrations.
     * 周结算 结算表
     * @return void
     */
    public function up()
    {
        Schema::create('week_checkouts', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->index()->comment('用户ID');
            $table->decimal('profit',16,4)->comment('实际赢利');
            $table->decimal('profit_checkout',16,4)->comment('赢利结账的50%');
            $table->decimal('volume',5,2)->default(0)->comment('交易手数');
            $table->mediumText('all_data')->comment('一周所有数据json');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('week_checkouts');
    }
}
